<%@ Page Language="C#" AutoEventWireup="false" MasterPageFile="ScreenMasterPage.master" %>
<asp:Content ContentPlaceHolderID="Head" runat="server">

	<script type="text/javascript">
		window.top.importCommonOshControl(this, "Menu.htc");
		window.top.importThemedOshControl(this, "Clock.htc");
		window.top.importThemedOshControl(this, "MenuItem.htc");

		screen.onShow.attach(this, onShow);
		
		function onShow(sender, event)
		{
			MainMenu.first();
			var info = osh.progDVB.getRecordingInfo();
			updateMenuItemLabel(info == null);
		}
		function switchRecord()
		{
			var info = osh.progDVB.getRecordingInfo();
			if(info == null)
				osh.progDVB.startRecord();
			else
				osh.progDVB.stopRecord();
			osh.navigator.go("QuickInfo");
		}
		function updateMenuItemLabel(record)
		{
			if(record)
				mi1Label.innerHTML = "Start Now";
			else
				mi1Label.innerHTML = "Stop Now";
		}
	</script>

</asp:Content>
<asp:Content ContentPlaceHolderID="Body" runat="server">

	<h1>record</h1>

	<osh:Clock mode="brief" />

	<osh:Menu id="MainMenu" selected="true">
		<osh:MenuItem id="mi1" onclick="switchRecord();"><span id="mi1Label">Start Now</span> </osh:MenuItem>
		<osh:MenuItem id="mi2" disabled="true" onclick="">My Records </osh:MenuItem>
		<osh:MenuItem id="mi3" onclick="osh.navigator.back();">Back </osh:MenuItem>
	</osh:Menu>

</asp:Content>
